/*
 * file name:soft_timer.h
 * version :v1.0.0
 * Change Logs:
 * Date             Author      	main change
 * 2024-09-30     	lanxin          the first version
 *
*/

/********************************************* READ ME BEGIN *************************************************************/

/* Brief:
 *
 * * 1.基于 unix 时间戳的软件定时器。
 *
*/

/********************************************* READ ME END ***************************************************************/

#ifndef _soft_timer_H
#define _soft_timer_H

/* source file */
#include "rtthread.h"
#include "sys/time.h"

/* public define */

/* variable typedef */
typedef void ( *tmr_cb_t ) ( time_t time, void *argv );

/* function typedef */

/* variable declaration for other to use */

/* function declaration for other to use */
void soft_tmr_init ( rt_uint8_t priority, rt_uint16_t stack_size );
void soft_tmr_schedule ( time_t t_now );
rt_list_t *soft_tmr_create ( time_t t_triger, tmr_cb_t cb, void *argv, uint32_t period );
int soft_tmr_delete ( rt_list_t *list_tmr );
void soft_tmr_delete_all ( void );
int soft_tmr_set_period ( rt_list_t *list_tmr, uint32_t period );

#endif /* _soft_timer_H */
